Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(shortint): new parameters #1886

Merged
merged 12 commits into from
Jan 7, 2025
Merged

chore(shortint): new parameters #1886

merged 12 commits into from
Jan 7, 2025

Conversation

nsarlin-zama
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the cla-signed label Dec 17, 2024
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/params_zkv1 branch 2 times, most recently from 25d6bb9 to 92ea542 Compare December 17, 2024 15:07
@zama-bot zama-bot removed the approved label Dec 19, 2024
@nsarlin-zama nsarlin-zama changed the title chore(shortint): new parameters for zkv1 chore(shortint): new parameters Dec 19, 2024
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/params_zkv1 branch 4 times, most recently from 7858942 to b173358 Compare December 20, 2024 08:53
@nsarlin-zama nsarlin-zama requested a review from soonum December 20, 2024 08:59
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/params_zkv1 branch 2 times, most recently from 9b313f2 to 0fab62b Compare December 20, 2024 10:41
@soonum
Copy link
Contributor

soonum commented Dec 20, 2024

Should we set aliases for Gaussian common parameters (like 2_2) just like the Tuniform flavour ? @IceTDrinker
We could do it in a different PR as is not changing directly the behavior of the current implementation.

Copy link
Contributor

@soonum soonum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredible and tedious job, thanks a lot @nsarlin-zama !

@nsarlin-zama
Copy link
Contributor Author

I added a new enum inside the CompactPublicKeyEncryptionParameters: SupportedCompactPkeZkScheme. It can take 3 values: ZkNotSupported, V1 and V2.
ZkNotSupported is used when pke parameters are derived from compute paramters and we cannot guess the correct zk version to use.

V1 params will always generate a V1 crs and V2 params a V2 crs, which will make incompatibility issues less likely. However, since the zk version is not stored in the keyswitch paramters, it is still possible to mix pke parameters for v2 with keyswitch parameters for v1.

@nsarlin-zama nsarlin-zama force-pushed the ns/chore/params_zkv1 branch 6 times, most recently from 48e87b8 to 7303b32 Compare January 6, 2025 16:21
@zama-bot zama-bot removed the approved label Jan 6, 2025
gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh I think this is not correct as the ConfigBuilder is using the default config, not required to change for the release tomorrow, this is purely at the GitHub repo level, please make a note to look for ConfigBuilder::default() usage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing something, but this is just a rename ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the regression was introduced in a previous pr, so yeah we might as well fix it in another pr if that's not blocking for the release

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default params for the config is TUniform I believe so the config above in the code (read the full source) should be changed, this parameter set for keyswitch does not match, can be done in a follow up PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but the change to tuniform is not from this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep 100%

gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same story here

use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here most likely as well

use tfhe::shortint::parameters::PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
use tfhe::shortint::parameters::V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

her as well

Comment on lines +23 to +37
V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64,
V0_11_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soonum will this break benchmark displays in Grafana ?

we may need to be a bit more flexible on parameter names to authorize the prefix v_something

gen_keys(PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
gen_keys(V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default params for the config is TUniform I believe so the config above in the code (read the full source) should be changed, this parameter set for keyswitch does not match, can be done in a follow up PR

@nsarlin-zama nsarlin-zama merged commit 3c3e2d7 into main Jan 7, 2025
106 of 119 checks passed
@nsarlin-zama nsarlin-zama deleted the ns/chore/params_zkv1 branch January 7, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants